<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.wzx.bean.User" %>
<%@ page import="com.wzx.bean.Birthday" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--        1域对象存放集合List list底层是数组 []--%>
    <%
        User user1 = new User("jack",22,"男",new Birthday(2000,1,1));
        User user2 = new User("rose",20,"女",new Birthday(2000,1,1));
        User user3 = new User("tony",22,"男",new Birthday(2000,1,1));
        List<User> list = new ArrayList<>();
        list.add(user1);
        list.add(user2);
        list.add(user3);

        request.setAttribute("list",list);
    %>
    <%--    2使用表达式取值--%>
    ${list[0].name}
    ${list[0].gender}
    ${list[0].age}
    ${list[0].birthday.year}
</body>
</html>
